<template lang="html">
  <el-dialog
    title="合并订单要求"
    center
    append-to-body
    custom-class="user-dialog"
    :visible.sync="dialogVisible"
    width="410px"
    :before-close="handleClose"
  >
    <!-- 暂无接口可以判断订单是否分别完成需求 先暂改为123要求点 -->
    <ul class="merge-list">
      <li><span class="number">1</span>相同品种的订单</li>
      <li><span class="number">2</span>订单未下达计划的订单</li>
      <li><span class="number">3</span>订单组织相同的订单</li>
    </ul>
    <!-- <ul class='merge-list'>
      <li><i class="el-icon-success"/>相同品种的订单</li>
      <li><i class="el-icon-success"/>订单未下达计划的订单</li>
      <li><i class="el-icon-success"/>订单组织相同的订单</li>
    </ul> -->
    <!-- footer -->
    <template slot="footer">
      <el-button size="small" @click="handleClose()">取 消</el-button>
      <el-button size="small" type="primary" @click="merge">合 并</el-button>
    </template>
  </el-dialog>
</template>

<script>
import { mergeOrder } from '@/api/order';
export default {
  props: ['dialogVisible', 'mergeIds'],
  methods: {
    async merge() {
      const res = await mergeOrder({ ddbhs: this.mergeIds });
      if (res.code == 1) {
        this.$message({
          message: '合并成功',
          iconClass: 'el-icon-success',
          customClass: 'common-message'
        });
        this.$emit('close', 'update');
      }
    },
    handleClose() {
      this.$emit('close');
    }
  }
};
</script>
